Transcribed Image Text: Consider a polymorphic binary tree type.
Write a function that will return the smallest value in the tree. You may use
the min function.
Since we may have Empty tree, we need to implement minTree with Maybe type, namely
minTree :: BTree Int -> Maybe Int. Using exceptions will be more challenging
in Haskell since exceptions are captured via Monad class.
-}
data BTree a
= Empty
| Leaf a
| Node a (BTree a) (BTree a)
tree1 :: BTree Int
tree1 = Leaf 3
tree2 :: BTree Int
tree2 = Node 4 tree1 tree1
tree3 :: BTree Int
tree3 = Node 6 tree2 tree1
minTree :: BTree Int -> Maybe Int